package cn.sccl.dirms.security.model;

import cn.sccl.common.exception.BusinessException;
import cn.sccl.common.model.BaseModel;

/**
* 用户表
* 数据库表 T_SEC_USER 的实体对象
* Created by 杨浩宇 on 2016-08-08.
*/
public class User extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="t_sec_user";

    private java.lang.String password;//密码
    private java.lang.String name;//登录用户
    private java.lang.String sex;//性别
    private java.sql.Timestamp pwdUpdateTime;//密码更新时间
    private java.lang.String userName;//用户名称（展示名称）
    private java.lang.String unitId;//用户所属机构
    private java.lang.String cardNo;//证件号
    private java.lang.Long cardType;//证件类型
    private java.lang.String diyDir;//个性化样式目录

    public String getDiyDir() {
        return diyDir;
    }

    public void setDiyDir(String diyDir) {
        this.diyDir = diyDir;
    }

    public void setPassword(java.lang.String password){
    this.password = password;
    }

        public java.lang.String getPassword(){
    return this.password;
    }
    public void setName(java.lang.String name){
    this.name = name;
    }

        public java.lang.String getName(){
    return this.name;
    }
    public void setSex(java.lang.String sex){
    this.sex = sex;
    }

        public java.lang.String getSex(){
    return this.sex;
    }
    public void setPwdUpdateTime(java.sql.Timestamp pwdUpdateTime){
    this.pwdUpdateTime = pwdUpdateTime;
    }

        public java.sql.Timestamp getPwdUpdateTime(){
    return this.pwdUpdateTime;
    }
    public void setUserName(java.lang.String userName){
    this.userName = userName;
    }

        public java.lang.String getUserName(){
    return this.userName;
    }
    public void setUnitId(java.lang.String unitId){
    this.unitId = unitId;
    }

        public java.lang.String getUnitId(){
    return this.unitId;
    }
    public void setCardNo(java.lang.String cardNo){
    this.cardNo = cardNo;
    }

        public java.lang.String getCardNo(){
    return this.cardNo;
    }
    public void setCardType(java.lang.Long cardType){
    this.cardType = cardType;
    }

        public java.lang.Long getCardType(){
    return this.cardType;
    }

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends User> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
            t.setId(this.
            getId());
            t.setPassword(this.
            getPassword());
            t.setName(this.
            getName());
            t.setSex(this.
            getSex());
            t.setPwdUpdateTime(this.
            getPwdUpdateTime());
            t.setCreateTime(this.
            getCreateTime());
            t.setUpdateTime(this.
            getUpdateTime());
            t.setDeleteFlag(this.isDeleteFlag());
            t.setUserName(this.
            getUserName());
            t.setUnitId(this.
            getUnitId());
            t.setCardNo(this.
            getCardNo());
            t.setCardType(this.
            getCardType());
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }